package org.xxpay.core.entity;

import java.util.Date;

public class AlipayCash extends BaseModel {

    public static final byte TASK_STATUS_CREATE_FAIL = 0; //任务状态： 创建失败
    public static final byte TASK_STATUS_CREATE_SUCCESS = 1; //任务状态：创建成功
    public static final byte TASK_STATUS_ING = 2; //任务状态： 红包发放中
    public static final byte TASK_STATUS_FINISH = 3; //任务状态： 红包发放完成
    public static final byte TASK_STATUS_CANCEL = 4; //任务状态： 已取消发放

    public static final String ALIPAY_STATUS_INIT = "INIT"; //支付宝状态：初始化完成
    public static final String ALIPAY_STATUS_CREATED = "CREATED"; //支付宝状态：已创建未打款
    public static final String ALIPAY_STATUS_PAID = "PAID"; //支付宝状态：已打款
    public static final String ALIPAY_STATUS_READY = "READY"; //支付宝状态：活动已开始
    public static final String ALIPAY_STATUS_PAUSE = "PAUSE"; //支付宝状态：活动已暂停
    public static final String ALIPAY_STATUS_CLOSED = "CLOSED"; //支付宝状态：活动已结束
    public static final String ALIPAY_STATUS_SETTLE = "SETTLE"; //支付宝状态：活动已清算

    /**
     * ID
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     * 红包名称
     *
     * @mbg.generated
     */
    private String couponName;

    /**
     * 红包描述, 体现在账单描述中
     *
     * @mbg.generated
     */
    private String prizeMsg;

    /**
     * random=随机, fixed=固定金额
     *
     * @mbg.generated
     */
    private String prizeType;

    /**
     * 活动发放总金额，单位分
     *
     * @mbg.generated
     */
    private Long totalMoney;

    /**
     * 红包个数
     *
     * @mbg.generated
     */
    private Integer totalNum;

    /**
     * 红包开始时间
     *
     * @mbg.generated
     */
    private Date startTime;

    /**
     * 红包结束时间
     *
     * @mbg.generated
     */
    private Date endTime;

    /**
     * 用户参与次数,频率限制
     *
     * @mbg.generated
     */
    private String sendFreqency;

    /**
     * 任务状态：0-创建失败, 1-创建成功, 2-红包发放中, 3-红包发放完成 4-已取消发放
     *
     * @mbg.generated
     */
    private Byte taskStatus;

    /**
     * 账户模板ID
     *
     * @mbg.generated
     */
    private Long accountTemplateId;

    /**
     * 支付宝红包状态：CREATED: 已创建未打款, PAID:已打款, READY:活动已开始, PAUSE:活动已暂停, CLOSED:活动已结束, SETTLE:活动已清算
     *
     * @mbg.generated
     */
    private String alipayStatus;

    /**
     * 支付宝返回的现金红包活动号
     *
     * @mbg.generated
     */
    private String alipayCrowdNo;

    /**
     * 支付宝返回的原始活动号
     *
     * @mbg.generated
     */
    private String alipayOriginCrowdNo;

    /**
     * 支付宝返回的已发放金额, 单位,分
     *
     * @mbg.generated
     */
    private Long alipaySendAmount;

    /**
     * 支付宝返回的付款链接
     *
     * @mbg.generated
     */
    private String alipayPayUrl;

    /**
     * 如创建失败，支付宝返回错误消息
     *
     * @mbg.generated
     */
    private String alipayErrorMsg;

    /**
     * 创建时间
     *
     * @mbg.generated
     */
    private Date createTime;

    /**
     * 更新时间
     *
     * @mbg.generated
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public String getPrizeMsg() {
        return prizeMsg;
    }

    public void setPrizeMsg(String prizeMsg) {
        this.prizeMsg = prizeMsg;
    }

    public String getPrizeType() {
        return prizeType;
    }

    public void setPrizeType(String prizeType) {
        this.prizeType = prizeType;
    }

    public Long getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(Long totalMoney) {
        this.totalMoney = totalMoney;
    }

    public Integer getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getSendFreqency() {
        return sendFreqency;
    }

    public void setSendFreqency(String sendFreqency) {
        this.sendFreqency = sendFreqency;
    }

    public Byte getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(Byte taskStatus) {
        this.taskStatus = taskStatus;
    }

    public Long getAccountTemplateId() {
        return accountTemplateId;
    }

    public void setAccountTemplateId(Long accountTemplateId) {
        this.accountTemplateId = accountTemplateId;
    }

    public String getAlipayStatus() {
        return alipayStatus;
    }

    public void setAlipayStatus(String alipayStatus) {
        this.alipayStatus = alipayStatus;
    }

    public String getAlipayCrowdNo() {
        return alipayCrowdNo;
    }

    public void setAlipayCrowdNo(String alipayCrowdNo) {
        this.alipayCrowdNo = alipayCrowdNo;
    }

    public String getAlipayOriginCrowdNo() {
        return alipayOriginCrowdNo;
    }

    public void setAlipayOriginCrowdNo(String alipayOriginCrowdNo) {
        this.alipayOriginCrowdNo = alipayOriginCrowdNo;
    }

    public Long getAlipaySendAmount() {
        return alipaySendAmount;
    }

    public void setAlipaySendAmount(Long alipaySendAmount) {
        this.alipaySendAmount = alipaySendAmount;
    }

    public String getAlipayPayUrl() {
        return alipayPayUrl;
    }

    public void setAlipayPayUrl(String alipayPayUrl) {
        this.alipayPayUrl = alipayPayUrl;
    }

    public String getAlipayErrorMsg() {
        return alipayErrorMsg;
    }

    public void setAlipayErrorMsg(String alipayErrorMsg) {
        this.alipayErrorMsg = alipayErrorMsg;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", couponName=").append(couponName);
        sb.append(", prizeMsg=").append(prizeMsg);
        sb.append(", prizeType=").append(prizeType);
        sb.append(", totalMoney=").append(totalMoney);
        sb.append(", totalNum=").append(totalNum);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", sendFreqency=").append(sendFreqency);
        sb.append(", taskStatus=").append(taskStatus);
        sb.append(", accountTemplateId=").append(accountTemplateId);
        sb.append(", alipayStatus=").append(alipayStatus);
        sb.append(", alipayCrowdNo=").append(alipayCrowdNo);
        sb.append(", alipayOriginCrowdNo=").append(alipayOriginCrowdNo);
        sb.append(", alipaySendAmount=").append(alipaySendAmount);
        sb.append(", alipayPayUrl=").append(alipayPayUrl);
        sb.append(", alipayErrorMsg=").append(alipayErrorMsg);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AlipayCash other = (AlipayCash) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName()))
                && (this.getPrizeMsg() == null ? other.getPrizeMsg() == null : this.getPrizeMsg().equals(other.getPrizeMsg()))
                && (this.getPrizeType() == null ? other.getPrizeType() == null : this.getPrizeType().equals(other.getPrizeType()))
                && (this.getTotalMoney() == null ? other.getTotalMoney() == null : this.getTotalMoney().equals(other.getTotalMoney()))
                && (this.getTotalNum() == null ? other.getTotalNum() == null : this.getTotalNum().equals(other.getTotalNum()))
                && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
                && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
                && (this.getSendFreqency() == null ? other.getSendFreqency() == null : this.getSendFreqency().equals(other.getSendFreqency()))
                && (this.getTaskStatus() == null ? other.getTaskStatus() == null : this.getTaskStatus().equals(other.getTaskStatus()))
                && (this.getAccountTemplateId() == null ? other.getAccountTemplateId() == null : this.getAccountTemplateId().equals(other.getAccountTemplateId()))
                && (this.getAlipayStatus() == null ? other.getAlipayStatus() == null : this.getAlipayStatus().equals(other.getAlipayStatus()))
                && (this.getAlipayCrowdNo() == null ? other.getAlipayCrowdNo() == null : this.getAlipayCrowdNo().equals(other.getAlipayCrowdNo()))
                && (this.getAlipayOriginCrowdNo() == null ? other.getAlipayOriginCrowdNo() == null : this.getAlipayOriginCrowdNo().equals(other.getAlipayOriginCrowdNo()))
                && (this.getAlipaySendAmount() == null ? other.getAlipaySendAmount() == null : this.getAlipaySendAmount().equals(other.getAlipaySendAmount()))
                && (this.getAlipayPayUrl() == null ? other.getAlipayPayUrl() == null : this.getAlipayPayUrl().equals(other.getAlipayPayUrl()))
                && (this.getAlipayErrorMsg() == null ? other.getAlipayErrorMsg() == null : this.getAlipayErrorMsg().equals(other.getAlipayErrorMsg()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode());
        result = prime * result + ((getPrizeMsg() == null) ? 0 : getPrizeMsg().hashCode());
        result = prime * result + ((getPrizeType() == null) ? 0 : getPrizeType().hashCode());
        result = prime * result + ((getTotalMoney() == null) ? 0 : getTotalMoney().hashCode());
        result = prime * result + ((getTotalNum() == null) ? 0 : getTotalNum().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getSendFreqency() == null) ? 0 : getSendFreqency().hashCode());
        result = prime * result + ((getTaskStatus() == null) ? 0 : getTaskStatus().hashCode());
        result = prime * result + ((getAccountTemplateId() == null) ? 0 : getAccountTemplateId().hashCode());
        result = prime * result + ((getAlipayStatus() == null) ? 0 : getAlipayStatus().hashCode());
        result = prime * result + ((getAlipayCrowdNo() == null) ? 0 : getAlipayCrowdNo().hashCode());
        result = prime * result + ((getAlipayOriginCrowdNo() == null) ? 0 : getAlipayOriginCrowdNo().hashCode());
        result = prime * result + ((getAlipaySendAmount() == null) ? 0 : getAlipaySendAmount().hashCode());
        result = prime * result + ((getAlipayPayUrl() == null) ? 0 : getAlipayPayUrl().hashCode());
        result = prime * result + ((getAlipayErrorMsg() == null) ? 0 : getAlipayErrorMsg().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }
}